package com.dfbz.service.impl;

import com.dfbz.dao.FavoriteDao;
import com.dfbz.model.Favorite;
import com.dfbz.service.FavoriteService;

import java.util.ArrayList;

public class FavoriteServiceImpl implements FavoriteService {
    FavoriteDao favoriteDao=new FavoriteDao();
    @Override
    public Favorite findById(Integer id) {
        return favoriteDao.findByid(id);
    }

    @Override
    public ArrayList<Favorite> findList() {
        return favoriteDao.findList();
    }

    @Override
    public void save(Favorite favorite) {
        favoriteDao.save(favorite);
    }

    @Override
    public void deleteById(Integer id) {
        favoriteDao.deleteById(id);
    }

    @Override
    public void update(Favorite favorite) {
        favoriteDao.update(favorite);
    }

    @Override
    public void deleteFav(Integer uId, Integer aId) {
        favoriteDao.deleteFav(uId,aId);
    }
}
